#ifndef _USART_H_
#define _USART_H_

#include "stm32f10x.h"
#include "platform_config.h"

typedef USART_TypeDef* USART_T;

extern int USART_Open(USART_TypeDef *usart, uint32_t baudrate, int rxBufLen);
extern int USART_Close(USART_TypeDef *USARTx);
extern int USART_Write(USART_TypeDef *USARTx, const char *buffer, int len);
extern int USART_Read(USART_TypeDef *USARTx, char *buffer, int len);
extern int USART_Putc(USART_TypeDef *USARTx, int c);

#endif /* ifndef _USART_H_ */
